import { GCellRenderer } from "../../../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../../../common/ObjCreate";
import { GlobalStyle } from "../../../../../common/global/GlobalStyle";
import { JumpFloorItemInfo } from "./JumpFloorItemInfo";
import { FilterConst } from "../../../../../component/gconst/FilterConst";
import { GCheckBox } from "../../../../../../com/mui/controls/GCheckBox";
import { GLabel } from "../../../../../../com/mui/controls/GLabel";
//class JumpFloorItem
    
    export  class JumpFloorItem extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            this._cb = ObjCreate.createCheckBox("", 0, 0, 30, 28, this, "GRadioButton");
            this._cb.drawNow();
            this._label = ObjCreate.createLabel("", 20, 4, 260, 36, flash.text.TextFormatAlign.LEFT, this, true, GlobalStyle.color1Uint);
            this._label.wordWrap = true;
            this._label.drawNow();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            this._info = arg1 as JumpFloorItemInfo;
            this.updateInfo();
            return;
        }

        public /* override */ get data(): Object
        {
            return this._info;
        }

        /* internal  */updateInfo(): void
        {
            if (!this._info) 
            {
                return;
            }
            this._label.htmlText = this._info.text;
            this._label.drawNow();
            if (this._info.selectable) 
            {
                this.mouseEnabled = true;
                this.mouseChildren = true;
                this.filters = [];
            }
            else 
            {
                this.mouseEnabled = false;
                this.mouseChildren = false;
                this.filters = [FilterConst.colorFilter2];
            }
            return;
        }

        public /* override */ set selected(arg1: Boolean)
        {
            super.selected = arg1;
            if (this._info) 
            {
                this._info.selected = arg1;
                this._cb.selected = this._info.selected;
                this._cb.drawNow();
            }
            else 
            {
                this._cb.selected = false;
                this._cb.drawNow();
            }
            return;
        }

        /* internal */ /* var */_info: JumpFloorItemInfo;

        /* internal */ /* var */_cb: GCheckBox;

        /* internal */ /* var */_label: GLabel;
    }
